-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Enable different entity managers for multiple log entities #44
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to consider ODM also.
@@ -32,9 +31,9 @@ class DoctrineObjectEventResolver implements EventResolverInterface | |||
protected $identity = ['', '']; | |||
|
|||
/** | |||
* @var ManagerRegistry | |||
* @var \Doctrine\ORM\EntityManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we also support ODM, we don't want direct dependency with ORM. You can see we remove the dependency in a earlier commit
@@ -30,7 +30,8 @@ | |||
"phpunit/phpunit": "^5.0 || ^6.0", | |||
"friendsofsymfony/user-bundle": "^2.0", | |||
"php-coveralls/php-coveralls": "^2.1", | |||
"doctrine/common": ">=2.2 <3.0" | |||
"doctrine/common": ">=2.2 <3.0", | |||
"doctrine/orm": "^2.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No dependency should be with ORM
/** | ||
* @param AuditLog $event | ||
*/ | ||
protected function saveLog(AuditLog $event) | ||
{ | ||
$this->getManager()->persist($event); | ||
$this->getManager()->flush($event); | ||
$manager = $this->doctrine->getManagerForClass($event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getManagerForClass expect class name not an object
WIP